public abstract class TemplateMethod
{
	public static void main(String[] args) {
		TemplateMethod ta = new ProductA();
		TemplateMethod tb = new ProductB();
		ta.show();
		tb.show();
	}
	public void show()
	{
		System.out.println(String.format("Template %s", getName()));
	}
	protected abstract String getName();
}

class ProductA extends TemplateMethod
{
    @Override
	protected String getName() { return "ProductA"; }
}
class ProductB extends TemplateMethod
{
    @Override
	protected String getName() { return "ProductB"; }
}